\hypertarget{structnih_1_1_octree__builder}{
\section{nih\-:\-:\-Octree\-\_\-builder$<$ \-Integer $>$ \-Struct \-Template \-Reference}
\label{structnih_1_1_octree__builder}\index{nih\-::\-Octree\-\_\-builder$<$ Integer $>$@{nih\-::\-Octree\-\_\-builder$<$ Integer $>$}}
}


{\ttfamily \#include $<$octree\-\_\-builder.\-h$>$}

\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{structnih_1_1_octree__builder_a4a7ff86186fca6ebe6122cbf5d85354a}{\-Octree\-\_\-builder} (thrust\-::device\-\_\-vector$<$ \hyperlink{structnih_1_1_octree__node}{\-Octree\-\_\-node} $>$ \&octree, thrust\-::device\-\_\-vector$<$ uint2 $>$ \&leaves, thrust\-::device\-\_\-vector$<$ uint32 $>$ \&index)
\item 
{\footnotesize template$<$typename Iterator $>$ }\\void \hyperlink{structnih_1_1_octree__builder_a54d263ca6cbb13cef60860aa19c2423a}{build} (const \hyperlink{structnih_1_1_bbox}{\-Bbox3f} bbox, const \-Iterator points\-\_\-begin, const \-Iterator points\-\_\-end, const uint32 max\-\_\-leaf\-\_\-size)
\end{DoxyCompactItemize}
\subsection*{\-Public \-Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{structnih_1_1_octree__builder_a3c55b9466512a28df3ef0e40a2669a10}{
thrust\-::device\-\_\-vector\*
$<$ \hyperlink{structnih_1_1_octree__node}{\-Octree\-\_\-node} $>$ $\ast$ {\bfseries m\-\_\-octree}}
\label{structnih_1_1_octree__builder_a3c55b9466512a28df3ef0e40a2669a10}

\item 
\hypertarget{structnih_1_1_octree__builder_a1071d744694cdcd3a93538d75e2e9bcb}{
thrust\-::device\-\_\-vector$<$ uint2 $>$ $\ast$ {\bfseries m\-\_\-leaves}}
\label{structnih_1_1_octree__builder_a1071d744694cdcd3a93538d75e2e9bcb}

\item 
\hypertarget{structnih_1_1_octree__builder_a5feded65da8176dc2c7a6669a69d971a}{
thrust\-::device\-\_\-vector$<$ uint32 $>$ $\ast$ {\bfseries m\-\_\-index}}
\label{structnih_1_1_octree__builder_a5feded65da8176dc2c7a6669a69d971a}

\item 
\hypertarget{structnih_1_1_octree__builder_a16b96a11c3758198dee4f3d31b0b3295}{
thrust\-::device\-\_\-vector$<$ \-Integer $>$ {\bfseries m\-\_\-codes}}
\label{structnih_1_1_octree__builder_a16b96a11c3758198dee4f3d31b0b3295}

\item 
\hypertarget{structnih_1_1_octree__builder_aa9e543f03d24ea53b440eec482a95003}{
uint32 {\bfseries m\-\_\-levels} \mbox{[}64\mbox{]}}
\label{structnih_1_1_octree__builder_aa9e543f03d24ea53b440eec482a95003}

\item 
\hypertarget{structnih_1_1_octree__builder_a930342a937ec0c27130d1760444140eb}{
\hyperlink{structnih_1_1_bbox}{\-Bbox3f} {\bfseries m\-\_\-bbox}}
\label{structnih_1_1_octree__builder_a930342a937ec0c27130d1760444140eb}

\item 
\hypertarget{structnih_1_1_octree__builder_ab20ee091a8bc8963750b6231d8b43bb5}{
uint32 {\bfseries m\-\_\-node\-\_\-count}}
\label{structnih_1_1_octree__builder_ab20ee091a8bc8963750b6231d8b43bb5}

\item 
\hypertarget{structnih_1_1_octree__builder_ac04090ebcc2c3a2e25165c477f1d144b}{
uint32 {\bfseries m\-\_\-leaf\-\_\-count}}
\label{structnih_1_1_octree__builder_ac04090ebcc2c3a2e25165c477f1d144b}

\item 
\hypertarget{structnih_1_1_octree__builder_a3ef8a279ed45271b0bef0530932ae4c8}{
thrust\-::device\-\_\-vector\*
$<$ \hyperlink{structnih_1_1_bintree__node}{\-Bintree\-\_\-node} $>$ {\bfseries m\-\_\-kd\-\_\-nodes}}
\label{structnih_1_1_octree__builder_a3ef8a279ed45271b0bef0530932ae4c8}

\item 
\hypertarget{structnih_1_1_octree__builder_ac19a42cbf82d21e270512c0121c329c8}{
\hyperlink{structnih_1_1cuda_1_1_bintree__gen__context}{cuda\-::\-Bintree\-\_\-gen\-\_\-context} {\bfseries m\-\_\-kd\-\_\-context}}
\label{structnih_1_1_octree__builder_ac19a42cbf82d21e270512c0121c329c8}

\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}
\subsubsection*{template$<$typename Integer$>$struct nih\-::\-Octree\-\_\-builder$<$ Integer $>$}

\-G\-P\-U-\/based octree builder

\-This class provides the context to generate octrees on the \-G\-P\-U starting from a set of unordered points. \-The output is a set of nodes with the corresponding leaves and a set of primitive indices into the input set of points. \-The output leaves will specify contiguous ranges into this index.


\begin{DoxyTemplParams}{\-Template Parameters}
{\em \-Integer} & an integer type that determines the number of bits used to compute the points' \-Morton codes. \-Accepted values are uint32 and uint64.\\
\hline
\end{DoxyTemplParams}
\-The following code snippet shows how to use this builder\-:


\begin{DoxyCode}
 #include <nih/octree/cuda/octree_builder.h>

 thrust::device_vector<Vector3f> points;
 ... // code to fill the input vector of points

 thrust::device_vector<Octree_node> octree_nodes;
 thrust::device_vector<uint2>       octree_leaves;
 thrust::device_vector<uint32>      octree_index;

 nih::Octree_builder<uint64> builder( octree_nodes, octree_leaves, octree_index
       );
 builder.build(
     Bbox3f( Vector3f(0.0f), Vector3f(1.0f) ),   // suppose all bboxes are in
       [0,1]^3
     points.begin(),                             // begin iterator
     points.end(),                               // end iterator
     4 );                                        // target 4 objects per leaf
\end{DoxyCode}
 

\subsection{\-Constructor \& \-Destructor \-Documentation}
\hypertarget{structnih_1_1_octree__builder_a4a7ff86186fca6ebe6122cbf5d85354a}{
\index{nih\-::\-Octree\-\_\-builder@{nih\-::\-Octree\-\_\-builder}!\-Octree\-\_\-builder@{\-Octree\-\_\-builder}}
\index{\-Octree\-\_\-builder@{\-Octree\-\_\-builder}!nih::Octree_builder@{nih\-::\-Octree\-\_\-builder}}
\subsubsection[{\-Octree\-\_\-builder}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename \-Integer$>$ {\bf nih\-::\-Octree\-\_\-builder}$<$ \-Integer $>$\-::{\bf \-Octree\-\_\-builder} (
\begin{DoxyParamCaption}
\item[{thrust\-::device\-\_\-vector$<$ {\bf \-Octree\-\_\-node} $>$ \&}]{octree, }
\item[{thrust\-::device\-\_\-vector$<$ uint2 $>$ \&}]{leaves, }
\item[{thrust\-::device\-\_\-vector$<$ uint32 $>$ \&}]{index}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{structnih_1_1_octree__builder_a4a7ff86186fca6ebe6122cbf5d85354a}
constructor


\begin{DoxyParams}{\-Parameters}
{\em octree} & output octree nodes array \\
\hline
{\em leaves} & output leaf array \\
\hline
{\em index} & output primitive index array \\
\hline
\end{DoxyParams}


\subsection{\-Member \-Function \-Documentation}
\hypertarget{structnih_1_1_octree__builder_a54d263ca6cbb13cef60860aa19c2423a}{
\index{nih\-::\-Octree\-\_\-builder@{nih\-::\-Octree\-\_\-builder}!build@{build}}
\index{build@{build}!nih::Octree_builder@{nih\-::\-Octree\-\_\-builder}}
\subsubsection[{build}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename Integer $>$ template$<$typename Iterator $>$ void {\bf nih\-::\-Octree\-\_\-builder}$<$ \-Integer $>$\-::build (
\begin{DoxyParamCaption}
\item[{const {\bf \-Bbox3f}}]{bbox, }
\item[{const \-Iterator}]{points\-\_\-begin, }
\item[{const \-Iterator}]{points\-\_\-end, }
\item[{const uint32}]{max\-\_\-leaf\-\_\-size}
\end{DoxyParamCaption}
)}}
\label{structnih_1_1_octree__builder_a54d263ca6cbb13cef60860aa19c2423a}
build an octree given a set of points


\begin{DoxyParams}{\-Parameters}
{\em bbox} & global bounding box \\
\hline
{\em points\-\_\-begin} & iterator to the beginning of the point sequence to sort \\
\hline
{\em points\-\_\-end} & iterator to the end of the point sequence to sort \\
\hline
{\em max\-\_\-leaf\-\_\-size} & maximum leaf size \\
\hline
\end{DoxyParams}


\-The documentation for this struct was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
octree/cuda/\hyperlink{octree__builder_8h}{octree\-\_\-builder.\-h}\item 
octree/cuda/octree\-\_\-builder\-\_\-inline.\-h\end{DoxyCompactItemize}
